<%--
  Created by IntelliJ IDEA.
  User: Mr.G
  Date: 2019/1/9
  Time: 18:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form class="layui-form" action="" lay-filter="yiqifrom" id="yiqifrom">
    <input type="hidden" id="yiqiname" name="yiqiname" class="layui-input">
    <table class="layui-table">
        <tbody>
        <tr>
            <td>仪器名称：</td>
            <td>
                <select id="instrId" name="instrId" lay-search lay-filter="yiqimc">
                </select>

                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" id="price_min" name="qian" placeholder="￥" autocomplete="off" disabled class="layui-input layui-disabled" value="100.00">
                    <input type="hidden" name="qian" id="qian">
                </div>
            </td>
            <td>预约医生：</td>
            <td>
                <select id="userId" name="userId" lay-search lay-filter="yisheng"></select>
            </td>
        </tr>
        <tr>
            <td>病历编号:</td>
            <td>
                <select name="caseNo" id="caseNos" lay-filter="yq" lay-verify="required" lay-search="">
                    <option value="">直接选择或搜索选择</option>
                </select>
            </td>
            <td>客户号或会员号:</td>
            <td><input type="text" id="memberId" name="memberId" class="layui-input"></td>
        </tr>
        <tr>
            <td>使用时间段:</td>
            <td><input type="text" name="reserveInstrStartDate" id="reserveInstrStartDate" lay-verify="date" placeholder="H点m分" autocomplete="off" class="layui-input"></td>
            <td>至</td>
            <td><input type="text" name="reserveInstrFinishDate" id="reserveInstrFinishDate" lay-verify="date2" placeholder="H点m分" autocomplete="off" class="layui-input"></td>
        </tr>
        </tbody>
    </table>
</form>
</body>


<script>
    laydate.render({
        elem: '#reserveInstrStartDate',
        type: 'time'
        ,format: 'H点m分'
    });
    laydate.render({
        elem: '#reserveInstrFinishDate',
        type: 'time'
        ,format: 'H点m分'
    });


    //取出医生数据
    $.get("${path}/yuyuedengji/yishengList",function(data){
        // console.log(data)
        $.each(data,function(){
            var opt = $("<option></option>").appendTo("#userId");
            opt.text(this.username).val(this.userid);
        });
        layui.form.render()
    });
    //治疗仪列表
    $.get("${path}/bingliluru/zhiliaoyiList",function(data){
        $.each(data,function(){
            var zhiliaoyiList = $("<option></option>").appendTo("#instrId");
            zhiliaoyiList.text(this.instrName).val(this.instrId);
        });
        layui.form.render()
    });
    //取出病例列表
    $.get('${path}/bingliluru/getjiuzhen',function (data) {
        $.each(data,function(){
            var opt = $("<option></option>").appendTo("#caseNos");
            opt.text(this.medicalRecordNo).val(this.medicalRecordNo);
        });
        layui.form.render();
    });

    //监听治疗仪选择事件
    form.on('select(yiqimc)', function(data){
        $.get("${path}/bingliluru/zhiliaoyijiage",{instrId:data.value},function (jiage) {
            $("#price_min").val(jiage);
            $("#qian").val(jiage);
        })
    });



</script>

</html>
